package sg.edu.nus.dbd.util;

import java.util.HashMap;
import java.util.Map;

public class Constants {
	public static final String SHARED_POOL_PARAM = "Shared Pool";
	public static final String BUFFER_CACHED_PARAM = "Buffer Cache";
	public static final String REDO_LOG_BUFFER_PARAM = "Redo Log Buffer";
	public static final String SORT_MEMORY_PARAM = "Memory Area Used For Sorting";
	public static final String ROLLBACK_SEGMENT_PARAM = "Rollback Segments";
	public static final String REDO_LOG_FILE_PARAM = "Redo Log Files";

	public static final String SHARED_POOL_METRIC_NAME = "Shared Pool Free %";
	public static final String BUFFER_CACHED_METRIC_NAME = "Buffer Cache Hit Ratio";
	public static final String REDO_LOG_BUFFER_METRIC_NAME = "Redo Allocation Hit Ratio";
	public static final String SORT_MEMORY_METRIC_NAME = "Memory Sorts Ratio";
	public static final String ROLLBACK_SEGMENT_METRIC_NAME = "User Rollbacks Percentage";
	public static final String REDO_LOG_FILE_METRIC_NAME = "Redo Log File Total Waits";

	public static final String SHARED_POOL_ID = "2114";
	public static final String BUFFER_CACHED_ID = "2000";
	public static final String REDO_LOG_BUFFER_ID = "2002";
	public static final String SORT_MEMORY_ID = "2001";
	public static final String ROLLBACK_SEGMENT_ID = "2025";

	public static Map DASHBOARD_PARAMS = new HashMap(6);

	static {
		DASHBOARD_PARAMS.put(SHARED_POOL_PARAM, SHARED_POOL_ID);
		DASHBOARD_PARAMS.put(BUFFER_CACHED_PARAM, BUFFER_CACHED_ID);
		DASHBOARD_PARAMS.put(REDO_LOG_BUFFER_PARAM, REDO_LOG_BUFFER_ID);
		DASHBOARD_PARAMS.put(SORT_MEMORY_PARAM, SORT_MEMORY_ID);
		DASHBOARD_PARAMS.put(ROLLBACK_SEGMENT_PARAM, ROLLBACK_SEGMENT_ID);
		DASHBOARD_PARAMS.put(REDO_LOG_FILE_PARAM, null);
	}

	public static Map DASHBOARD_PARAMS_INVERSE = new HashMap(6);

	static {
		DASHBOARD_PARAMS_INVERSE.put(SHARED_POOL_PARAM, Boolean.FALSE);
		DASHBOARD_PARAMS_INVERSE.put(BUFFER_CACHED_PARAM, Boolean.TRUE);
		DASHBOARD_PARAMS_INVERSE.put(REDO_LOG_BUFFER_PARAM, Boolean.FALSE);
		DASHBOARD_PARAMS_INVERSE.put(SORT_MEMORY_PARAM, Boolean.TRUE);
		DASHBOARD_PARAMS_INVERSE.put(ROLLBACK_SEGMENT_PARAM, Boolean.FALSE);
		DASHBOARD_PARAMS_INVERSE.put(REDO_LOG_FILE_PARAM, Boolean.FALSE);
	}

	public static Map DASHBOARD_PARAMS_METRIC = new HashMap(6);

	static {
		DASHBOARD_PARAMS_METRIC.put(SHARED_POOL_PARAM, SHARED_POOL_METRIC_NAME);
		DASHBOARD_PARAMS_METRIC.put(BUFFER_CACHED_PARAM,
				BUFFER_CACHED_METRIC_NAME);
		DASHBOARD_PARAMS_METRIC.put(REDO_LOG_BUFFER_PARAM,
				REDO_LOG_BUFFER_METRIC_NAME);
		DASHBOARD_PARAMS_METRIC.put(SORT_MEMORY_PARAM, SORT_MEMORY_METRIC_NAME);
		DASHBOARD_PARAMS_METRIC.put(ROLLBACK_SEGMENT_PARAM,
				ROLLBACK_SEGMENT_METRIC_NAME);
		DASHBOARD_PARAMS_METRIC.put(REDO_LOG_FILE_PARAM,
				REDO_LOG_FILE_METRIC_NAME);
	}
}
